<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <form action="" id="myForm" onsubmit="Submithandle" >
        <input type="text" name ="password">
        <button type="button" id="resetbtn">重置</button>
        <button type="submit">提交</button>
        <!--默认属性为提交 -->
    </form>
    <script>
        var resetbtn = document.getElementById("resetbtn");
        var myform = document.getElementById("myForm");

        resetbtn.onclick = function(){
            myform.reset();
        }
        function Submithandle(event){
            event.preventDefault();
            console.log("提交了数据");
        }
    </script>

</body>
</html>